package com.spring.demo6.eg5;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @author vhans
 */
@Component
public class InjectService3 {

    private IService service1;

    private IService service2;

    @Autowired
    @Qualifier("service1")
    public void setService1(IService service1) {
        this.service1 = service1;
    }

    @Autowired
    @Qualifier("service2")
    public void setService2(IService service2) {
        this.service2 = service2;
    }

    @Override
    public String toString() {
        return "InjectService3{" +
                "service1=" + service1 +
                ", service2=" + service2 +
                '}';
    }
}
